package com.cskaoyan.javase.io._2char._4buffer;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * BufferedReader,自带提高效率缓冲区的字符输入流
 *
 * @since 15:02
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo2 {
    public static void main(String[] args) throws IOException {
        // 1.创建对象
        BufferedReader reader = new BufferedReader(new FileReader("b.txt"));
        // 2.read读
        int readData;
        while ((readData = reader.read()) != -1) {
            System.out.println(((char) readData));
        }
        // 3.close
        reader.close();
    }
}
